	<?php
		include ("../includes/config.php");
		$city = $_GET['cityId'];
		$status = $_GET['status'];
		
		$query = "UPDATE cities
					   SET populair  =  '".$status."'
					   where id_city = ".$city;
						
		$exc = mysql_query($query) or die (mysql_error());
	?>
	<tr style="font-weight:bold;"><td>Stad</td><td>Populair</td><td>Edit</td><td>Verwijder</td></tr>
				<?php 
					$query = "SELECT C.country_name,id_city, X.city_name,populair FROM cities as X
									JOIN countries as C
									ON X.id_country = C.id_country 
									AND article = 1";
									
					$result = mysql_query($query);
					while ($city = mysql_fetch_array($result)){
						echo "<tr><td>".$city['city_name']."</td>";
						
						if($city['populair'] == 1){
							echo '<td><input onclick="makePopular(0,'.$city['id_city'].')" type="checkbox" checked="yes"/></td>';
						}else{
							echo '<td><input  onclick="makePopular(1,'.$city['id_city'].')" type="checkbox"/></td>';
						}
						echo '<td><a href="?editCity='.$city['id_city'].'"><img src="http://cdn1.iconfinder.com/data/icons/diagona/icon/10/018.png"/></a></td>';
						echo '<td><a href="?deleteCity='.$city['id_city'].'"><img  src="http://cdn1.iconfinder.com/data/icons/diagona/icon/10/101.png"/></a></td></tr>';
				}
					
				?>